#import pickle
import mod_dungeon2
from characters.player import playerPrototype

#def loadGame(file):
#    game = pickle.load(file)
#    return game

class Game:
    def __init__(self):
    	self.player = playerPrototype.instantiate()
        self.shareLOS = True
        self.levelMap = {} # Maps numbers to levels
        self.getLevel(1).addPlayer(self.player)
        
#    def save(self,file):
#        pickle.dump(self,file)
        
    def getLevel(self,levelNumber):
        level = self.levelMap.get(levelNumber)
        if not level:
            level = mod_dungeon2.createLevel((29,20),self,levelNumber)
            self.levelMap[levelNumber] = level
        return level